//
//  ActivityList.m
//  豆瓣2
//
//  Created by dllo on 15/11/6.
//  Copyright (c) 2015年 张鸿峰. All rights reserved.
//

#import "ActivityList.h"

@implementation ActivityList

- (void)dealloc
{
    [_image release];
    [_title release];
    [_wisher_count release];
    [_participant_count release];
    [super dealloc];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

#pragma mark -- 归档第二步:实现协议中编码方法
//对model进行编码
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.title forKey:@"title"];
    [aCoder encodeObject:self.wisher_count forKey:@"wisher_count"];
    [aCoder encodeObject:self.participant_count forKey:@"participant_count"];
    [aCoder encodeObject:self.image forKey:@"image"];
}

#pragma mark -- 归档第3步:实现协议中解码方法
//对model进行解码(反编码)
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        
        self.title = [aDecoder decodeObjectForKey:@"title"];
        self.image = [aDecoder decodeObjectForKey:@"image"];
        self.participant_count = [aDecoder decodeObjectForKey:@"participant_count"];
        self.wisher_count = [aDecoder decodeObjectForKey:@"wisher_count"];
    }
    return self;
}

@end
